﻿using UnityEngine;
using System.Collections;

public class PositionTransformation : Transformation
{

    public Vector3 position;

    public override Matrix4x4 Matrix {
        get
        {
            Matrix4x4 mat = new Matrix4x4();
            mat.SetRow(0, new Vector4(1, 0, 0, position.x));
            mat.SetRow(1, new Vector4(0, 1, 0, position.y));
            mat.SetRow(2, new Vector4(0, 0, 1, position.z));
            mat.SetRow(3, new Vector4(0, 0, 0, 1));
            return mat;
        }
    }

    public override Vector3 Apply(Vector3 point)
    {
        return point + position;
    }

}
